import request from '@/api/request'
import { IaddressDetail } from '@/types/my'

// 获取用户资料
export const getUserInfo = () => {
    return request.get('/api/user')
}
// 更换头像
export const changeAvatat = (params:any) => {
    return request.post('/api/user/avatar',params)
}

// 我的收藏
export const myCollect = (page:number) => {
    return request.get('/api/collects',{params:{page}})
}

//地址列表
export const addRessListApi = () => {
    return request.get('/api/address')
}
// 更新地址
export const updateRessListApi = (address:number,list:IaddressDetail) => {
    return request.put('/api/address/'+address,list)
}
// 地址详情
export const addressDetailApi = (address:number) => {
    return request.get('/api/address/'+address)
}
// 添加地址
export const createAddress = (list:object) => {
    return request.post('/api/address',list)
}
// 删除地址
export const deleteAddress = (address:number) => {
    return request.delete('/api/address/'+address)
}